package day6;

import java.util.Calendar;

/**
 * @author oldliu
 * @since 1.0
 */
public class CalendarTest {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        System.out.println(cal);
        System.out.println("毫秒数:"+cal.getTimeInMillis());
        System.out.println("Date:"+cal.getTime());
        //get,add
        int y = cal.get(Calendar.YEAR);
        System.out.println(y);
        System.out.println("月份："+cal.get(Calendar.MONTH));
        System.out.println("日："+cal.get(Calendar.DAY_OF_MONTH));
        System.out.println("?"+cal.get(Calendar.DAY_OF_YEAR));
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        cal.add(Calendar.HOUR,200);
        System.out.println(cal.getTime());
        cal.roll(Calendar.HOUR,1900);
        System.out.println(cal.getTime());
    }
}
